using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework.Domain.Generators
{
    [TestClass]
    public class WhenUsingDaysGenerator
    {
        [TestMethod]
        public void GenerateNextValueShouldReturn20090102For20090101()
        {
            DateTime givenDay = new DateTime(2009, 1, 1);
            IDiscreteValuesGenerator<DateTime> daysGenerator = new DaysGenerator();
            DateTime actual = daysGenerator.GenerateNextValue(givenDay);
            DateTime expected = new DateTime(2009, 1, 2);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void GeneratePreviousValueShouldReturn20090101For20090101()
        {
            DateTime givenDay = new DateTime(2009, 1, 2);
            IDiscreteValuesGenerator<DateTime> daysGenerator = new DaysGenerator();
            DateTime actual = daysGenerator.GeneratePreviousValue(givenDay);
            DateTime expected = new DateTime(2009, 1, 1);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void MinValueShouldReturn0()
        {
            IDiscreteValuesGenerator<DateTime> daysGenerator = new DaysGenerator();
            DateTime actual = daysGenerator.MinValue;
            DateTime expected = new DateTime(0);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void MaxValueShouldReturn99991231()
        {
            IDiscreteValuesGenerator<DateTime> daysGenerator = new DaysGenerator();
            DateTime actual = daysGenerator.MaxValue;
            DateTime expected = new DateTime(9999, 12, 31);
            Assert.AreEqual(expected, actual);
        }
    }
}